//
//  MainVC.swift
//  swift_airu
//
//  Created by A on 2025/9/19.
//

import UIKit
class MainVC: UITabBarController {

    override func viewDidLoad() {
        super.viewDidLoad()
        self.view.backgroundColor = .yellow
        
        self.setupVC()
        tabBar.barTintColor = .white
        tabBar.tintColor = .green
        tabBar.unselectedItemTintColor = .lightGray
        if #available(iOS 15.0, *) {
            let appearance = UITabBarAppearance()
            appearance.configureWithOpaqueBackground()
            appearance.backgroundColor = .white
            tabBar.standardAppearance = appearance
            tabBar.scrollEdgeAppearance = appearance
        } else {
            tabBar.backgroundColor = .white
        }
        // Do any additional setup after loading the view.
    }
    
    func setupVC (){
        let homeVC = AUHomeVC()
        homeVC.title = "home"
        homeVC.tabBarItem = UITabBarItem(title: "home", image: UIImage(named: "ic_Home")?.withRenderingMode(.alwaysOriginal), selectedImage: UIImage(named: "ic_Home_s")?.withRenderingMode(.alwaysOriginal))
        let homeNav = AUNavVC(rootViewController: homeVC)
        
         
        let messageVC = AUMessgeVC()
        messageVC.title = "message"
        messageVC.tabBarItem = UITabBarItem(title: "message", image: UIImage(named: "ic_Recommend")?.withRenderingMode(.alwaysOriginal), selectedImage: UIImage(named: "ic_Recommend_s")?.withRenderingMode(.alwaysOriginal))
        let messageNav = AUNavVC(rootViewController: messageVC)

        let profileVC = AUProfileVC()
        profileVC.title = "profile";
        profileVC.tabBarItem = UITabBarItem(title: "profile", image: UIImage(named: "ic_Message")?.withRenderingMode(.alwaysOriginal), selectedImage: UIImage(named: "ic_Message_s")?.withRenderingMode(.alwaysOriginal))
        let profileNav = AUNavVC(rootViewController: profileVC)

        let profileVC2 = AUProfileVC()
        profileVC2.title = "profile2";
        profileVC2.tabBarItem = UITabBarItem(title: "profile", image: UIImage(named: "ic_Profile")?.withRenderingMode(.alwaysOriginal), selectedImage: UIImage(named: "ic_Profile_s")?.withRenderingMode(.alwaysOriginal))
        let profileNav2 = AUNavVC(rootViewController: profileVC2)

        viewControllers = [homeNav,messageNav,profileNav,profileNav2]

        
    }
    /*
    // MARK: - Navigation

    // In a storyboard-based application, you will often want to do a little preparation before navigation
    override func prepare(for segue: UIStoryboardSegue, sender: Any?) {
        // Get the new view controller using segue.destination.
        // Pass the selected object to the new view controller.
    }
    */

}
